/*! \file Path.h
 *	\brief <write description for Path.h>
 *
 *	created:	2010/07/27
 *	created:	27:7:2010   17:48
 *	filename: 	C:\src\tactics-engine\libs\io\Path.h
 *	file path:	C:\src\tactics-engine\libs\io
 *	file base:	Path
 *	file ext:	h
 *	author:		Vitalii Trubchaninov
 *				venngraydog@gmail.com
 */

#ifndef _io_PATH_H_
#define _io_PATH_H_

#pragma once

#include "core/String.h"

namespace tt{
namespace io{

class PathBaseNoNormalize {};

template<typename StringType>
class PathTraits
{
public:
	typedef typename StringType::value_type CharType;

	CharType GetSeparatorChar();
	CharType GetSeparatorCharWrong();
	const CharType* GetSeparator();
};

template<typename StringType>
class PathBase
{
	typedef StringType ValueType;
public:
	PathBase();
	explicit PathBase(const ValueType&);
	PathBase(const ValueType&, const PathBaseNoNormalize&);
	PathBase(const PathBase&);
	PathBase& operator=(const PathBase&);

	PathBase operator/(const PathBase&);
	PathBase operator/(const ValueType&);

	Bool Empty() const;

	const ValueType& GetString() const;
	PathBase GetParentPath() const;

private:
	void Normalize();

protected:
	ValueType m_value;
};

typedef PathBase<StringA> PathA;
typedef PathBase<StringW> PathW;

#ifdef _UNICODE
	typedef PathW Path;
#else
	typedef PathA Path;
#endif

PathA ToAnsi(const PathW&);

} //namespace io
} //namespace tt
#include "io/Path.inl"

#endif //_io_PATH_H_